<?php
/**
 * Creater: 李青林
 * Date Time : 2018/10/24 15:12
 */

namespace App\Http\Models;


class StatisticsGoodsInfoLog extends BaseModel
{
    protected $table = 'statistics_goods_info_log';
    protected $guarded = [];

    /**
     * 记录保存日志
     * @param $status  商品操作的记录  0未审 1一审通过 ,2终审通过  3退回 4下架,5撤销,6主动下架 ,7自动采集删除,8采集下架,9机器纠错,10优惠券过期  ,11处理纠错
     * @param $type   商品类型    0平推单，1爆款单，2秒杀单,3 纠错统计
     * @param $data   array
     * @return bool
     */
    public static function saveGoodsInfoLog($status, $type, $gid,$operation_type, $data,$old_type)
    {
        $new_data['change_type'] = $status;
        $new_data['operation_type'] = $operation_type;
        $new_data['type'] = $type;
        $new_data['gid'] = $gid;
        $new_data['online'] = $data['online'];
        $new_data['all_unaudited'] = $data['all_unaudited'];
        $new_data['today_unaudited'] = $data['today_unaudited'];
        $new_data['today_adopt'] = $data['today_adopt'];
        $new_data['today_refuse'] = $data['today_refuse'];
        $new_data['old_type'] = $old_type;
        return self::create($new_data);
    }
}